package com.linkhub.oms.data.sync.api.yunexpress.domain.response;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Description: 拦截运单响应
 * @Author: Jaycle
 * @Date: 2024/06/30 16:41
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class InterceptResponse extends YunExpressBaseResponse implements Serializable {

    @JSONField(serialize = false, deserialize = false)
    public boolean success() {
        return SUCCESS_CODE.equals(getCode()) && item != null;
    }

    @JSONField(name = "Item")
    private Item item;
    /**
     * code
     */
    @JSONField(name = "Code")
    private String code;
    /**
     * message
     */
    @JSONField(name = "Message")
    private String message;
    /**
     * requestId
     */
    @JSONField(name = "RequestId")
    private String requestId;
    /**
     * timeStamp
     */
    @JSONField(name = "TimeStamp")
    private String timeStamp;

    /**
     * Item
     */
    @NoArgsConstructor
    @Data
    public static class Item {
        /**
         * orderNumber
         */
        @JSONField(name = "OrderNumber")
        private String orderNumber;
        /**
         * result
         */
        @JSONField(name = "Result")
        private String result;
        /**
         * type
         */
        @JSONField(name = "Type")
        private Integer type;
        /**
         * remark
         */
        @JSONField(name = "Remark")
        private String remark;
    }
}